/*
*	Developed by Leonardo Chatain and Pedro Dusso, at Universidade Federal do Rio Grande do Sul, Brasil, 2009/1
*	Source available at glpacman.codeplex.com
*/

#pragma once
#ifndef _VECTOR2D_H_
#define _VECTOR2D_H_

#include "Point2D.h"
#include "Definitions.h"

class Vector2D
{
protected:
	float x, y;

	double toDegrees(double angle);
	double toRad(double angle);

public:
	Vector2D(void);
	Vector2D(float X, float Y);
	Vector2D(Point2D p1, Point2D p2);
	~Vector2D(void);
	
	//Returns the norm of the vector
	float getNorm();
	//Normalizes the vector
	void normalize();
	//Returns the dot product between the vector and other vector
	float dotProduct(Vector2D other);
	// Multiplies the vector by a scalar
	Vector2D multiply(float c);
	// Returns the lowest positive angle between this and the other vector (CCW)
	float getAngleTo(Vector2D other);
	Vector2D rotate(float theta);



	// Getters and Setters
	inline float getX() { return x; }
	inline void setX(float X) { x = X; }
	inline float getY() { return y; }
	inline void setY(float Y) { y = Y; }
	inline void setXY(float X, float Y) { x = X; y = Y; }

};

#endif